PortList is an extension that helps find when an application does not create or dispose of GrafPorts and CGrafPorts properly. This kind of crash is really difficult to track down because it happens far away from where the bug really is.
An application must call ClosePort every time it calls either OpenPort or InitPort with the same pointer. Similarly for CloseCPort, OpenCPort, and InitCPort. Apple maintains a private list of pointers to the currently open ports. This PortList is walked everytime a PixPat is disposed, or whenever the screen changes depth. It is possible to put a garbage pointer in the PortList (by calling OpenCPort and never calling CloseCPort for example). Sometimes (admittedly very rarely) this will cause the system to try to de-reference handles that don't exist and other bad things.
One easy way to get into trouble is to allocate a handle, lock it, call OpenCPort, unlock it, do some things that cause the handle to move, lock it, and call CloseCPort. Although all of the memory is being disposed properly, different pointers were passed to OpenCport and CloseCPort. The system now can't find the moved block in the PortList so it can't properly maintain the PortList which is bad.
Note: you do not need to close the port if the heap it is in is about to be destroyed. For example you don't need to explicitly close all of your windows and offscreen ports when quitting an application.
PortList drops into macsbug with the message "Port already in PortList." if you are calling open port on the same pointer twice. This message could also appear if the port was not properly disposed and you just happened to get the same pointer again. PortList also drops into macsbug with the message "Port not found in PortList." if you call ClosePort with a pointer that was never passed to InitPort or OpenPort.
The init is really small, has little overhead, should not affect the performance of your machine. Please use it peridically for testing and debugging purposes. You'll make the Mac a nicer place to work.